/* 
 * File:   Time.cpp
 * Author: jp
 * 
 * Created on April 10, 2012, 4:11 PM
 */

#include "TimeFunc.h"
#include <string>
using namespace std;
string DateTimeNow()
{
    const int RFC1123_TIME_LENGTH = 29;
    time_t serverTime = time(NULL);
    char* buffer = (char*) malloc(RFC1123_TIME_LENGTH + 1);

    strftime(buffer, RFC1123_TIME_LENGTH + 1, "%a, %d %b %Y %H:%M:%S GMT", gmtime(&serverTime));
    

    return string(buffer);
}

